package com.oracle.lingshangejia.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.RelativeLayout;

import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.oracle.lingshangejia.R;
import com.oracle.lingshangejia.adapter.NoticeAdapter;
import com.oracle.lingshangejia.base.BaseActivity;

public class NoticeActivity extends BaseActivity implements View.OnClickListener {

    private RelativeLayout re_back;
    private XRecyclerView recyclerview_notice;
    private NoticeAdapter noticeAdapter;
    @Override
    public int intiLayout() {
        return R.layout.activity_notice;
    }

    @Override
    public void initView() {
        re_back=findViewById(R.id.re_back);
        re_back.setOnClickListener(this);
        recyclerview_notice=findViewById(R.id.recyclerview_notice);
    }

    @Override
    public void initData() {
        recyclerview_notice.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
        recyclerview_notice.setLoadingListener(new XRecyclerView.LoadingListener() {
            @Override
            public void onRefresh() {

                recyclerview_notice.refreshComplete();
            }

            @Override
            public void onLoadMore() {

                recyclerview_notice.loadMoreComplete();
            }

        });
        recyclerview_notice.setAdapter(noticeAdapter = new NoticeAdapter(this));
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()){

            //返回键
            case R.id.re_back:

                finish();
                break;
        }
    }
}
